import { ApiProperty } from '@nestjs/swagger';
import { IsDateString, IsNotEmpty, IsOptional, IsUUID } from 'class-validator';

export class CreateFromTemplateDto {
  @ApiProperty({
    description: 'User ID to assign the task to (optional for global tasks)',
    format: 'uuid',
    required: false,
    example: '550e8400-e29b-41d4-a716-446655440000',
  })
  @IsOptional()
  @IsUUID()
  assignedUserId?: string;

  @ApiProperty({
    description: 'Task start time',
    format: 'date-time',
    required: false,
    example: '2023-01-01T09:00:00Z',
  })
  @IsOptional()
  @IsDateString()
  startTime?: string;

  @ApiProperty({
    description: 'Task due time',
    format: 'date-time',
    required: true,
    example: '2023-12-31T23:59:59Z',
  })
  @IsNotEmpty()
  @IsDateString()
  dueTime: string;
}
